<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      //遍历对象去除对象中所有的值
      var obj = {
        while: '50cm',
        type: '活泼,调皮',
        age: 2,
        kill: ['抓家具,刨沙坑'],
        fn: function () {
          console.log('打滚','掉毛');
        }
      }
      //for (var 变量key  in 对象名字){
           //在此执行代码
      // }
      for (var key in obj){
          console.log(obj[key])  //使用对象[属性]
      }
    </script>
  </body>
</html>
